﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.Entity;
using QRCode.BusinessEntities;

namespace QRCode.BusinessLayer
{
    /// <summary>
    /// 数据上下文
    /// </summary>
    public class QRCodeContext:DbContext
    {

        /// <summary>
        /// 管理员集合
        /// </summary>
        public DbSet<Administrator> Administrators { get; set; }
        /// <summary>
        /// 角色
        /// </summary>
        public DbSet<Role> Roles { get; set; }
        public DbSet<User> Users { get; set; }
        public DbSet<Code> Codes { get; set; }
        public QRCodeContext() : base("name=MysqlDatabases")
        {
            Database.SetInitializer(new EntitiesContextInitializer());
        }
        //public QRCodeContext() : base("SalesERPDAL")
        //{
        //    Database.SetInitializer(new EntitiesContextInitializer());
        //}
    }
}
